/*	PureMVC AS3 / Flex Demo - Slacker 
	Copyright (c) 2008 Clifford Hall <clifford.hall@puremvc.org>
	Your reuse is governed by the Creative Commons Attribution 3.0 License */
package mvc.view
{
	import com.tools.traceTool.TraceTool;
	
	import flash.events.Event;
	
	import mx.events.FlexEvent;
	
	import org.puremvc.as3.patterns.mediator.Mediator;

	public class CollViewMediator extends Mediator
	{
		public static const NAME:String = 'CollViewMediator';
		public function CollViewMediator(viewComponent:Object)
		{
        	Trace("		START	constructor	"+this);
			super(NAME,viewComponent);
			Trace("		FINISH	constructor	"+this+'	'+collView);
		}
		private	function Trace(...args):void{TraceTool.send('cTrace', String(Object(this).constructor), args);}
		override public function onRemove():void{Trace("#	onRemove	");super.onRemove();}
		override public function onRegister():void
		{
			Trace("#	onRegister	addEventListener	"+collView);
			collView.addEventListener(FlexEvent.HIDE, onHide);
			collView.addEventListener(FlexEvent.SHOW, onShow);
		}
		protected function onHide(event:Event):void{Trace("#	onHide");}
		protected function onShow(event:Event):void{Trace("#	onShow");}
		protected function get collView():CollViewModule{return CollViewModule(viewComponent.child);}
	}
}